<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>走路</title>
    <style>
        /* 走路动画 */
        .walking {
            position: relative;
            margin: 50px auto;
            width: 120px;
            height: 180px;
            border: 1px solid #000000;
            overflow: hidden;
        }

        .walking>img {
            position: absolute;
            top: 0;
            left: 0;
            animation: walking 1s steps(8) 0s infinite;
        }

        @keyframes walking {
            form {
                left: 0;
            }

            to {
                left: -960px;
            }
        }
    </style>
</head>

<body>
    <!-- 走路动画 -->
    <div class="walking">
        <img src="./walking.png" alt="走路图片">
    </div>
</body>

</html>